<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/Frog_32px_1177822_easyicon.net.ico">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/Frog_32px_1177822_easyicon.net.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/Frog_16px_1177822_easyicon.net.ico">
  <link rel="mask-icon" href="/images/Frog_32px_1177822_easyicon.net.ico" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-minimal.min.css">
  <script src="/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"hxy1997.xyz","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":"valine","storage":true,"lazyload":true,"nav":null,"activeClass":"valine"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"输入关键字","hits_empty":"没有找到与「${query}」相关搜索","hits_stats":"${hits} 条相关记录，共耗时 ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.json"};
  </script>

  <meta name="description" content="使用Gitee Pages实现静态页面（悦听播放器(Gitee Pages) 和悦听播放器(GitHub Pages)）部署后 ，我尝试着将自己学习搭建的Vue电商项目托管至Gitee Pages，实现项目的正式上线 Vue电商项目(Gitee Pages)和Vue电商项目(GitHub Pages)">
<meta property="og:type" content="article">
<meta property="og:title" content="Vue项目部署到Gitee Pages和GitHub Pages">
<meta property="og:url" content="https://hxy1997.xyz/2021/03/11/vue%E9%A1%B9%E7%9B%AE%E9%83%A8%E7%BD%B2%E5%88%B0Gitee%20Pages%E5%92%8CGitHub%20Pages/index.html">
<meta property="og:site_name" content="hxy的博客">
<meta property="og:description" content="使用Gitee Pages实现静态页面（悦听播放器(Gitee Pages) 和悦听播放器(GitHub Pages)）部署后 ，我尝试着将自己学习搭建的Vue电商项目托管至Gitee Pages，实现项目的正式上线 Vue电商项目(Gitee Pages)和Vue电商项目(GitHub Pages)">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418145848.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150113.webp">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150049.webp">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150132.webp">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150154.webp">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150211.webp">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150226.webp">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150239.jpeg">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150250.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150259.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150309.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150320.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150327.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150337.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150626.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150611.png">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150530.png">
<meta property="article:published_time" content="2021-03-11T04:02:39.000Z">
<meta property="article:modified_time" content="2021-04-18T07:13:06.153Z">
<meta property="article:author" content="hxy">
<meta property="article:tag" content="Vue">
<meta property="article:tag" content="实战">
<meta property="article:tag" content="Gitee Pages">
<meta property="article:tag" content="GitHub Pages">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418145848.png">

<link rel="canonical" href="https://hxy1997.xyz/2021/03/11/vue%E9%A1%B9%E7%9B%AE%E9%83%A8%E7%BD%B2%E5%88%B0Gitee%20Pages%E5%92%8CGitHub%20Pages/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Vue项目部署到Gitee Pages和GitHub Pages | hxy的博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="hxy的博客" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">hxy的博客</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Mia san Mia!</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

  <a href="https://github.com/huxingyi1997" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://hxy1997.xyz/2021/03/11/vue%E9%A1%B9%E7%9B%AE%E9%83%A8%E7%BD%B2%E5%88%B0Gitee%20Pages%E5%92%8CGitHub%20Pages/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/Robben.gif">
      <meta itemprop="name" content="hxy">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="hxy的博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Vue项目部署到Gitee Pages和GitHub Pages
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-03-11 12:02:39" itemprop="dateCreated datePublished" datetime="2021-03-11T12:02:39+08:00">2021-03-11</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-04-18 15:13:06" itemprop="dateModified" datetime="2021-04-18T15:13:06+08:00">2021-04-18</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/web%E5%89%8D%E7%AB%AF/" itemprop="url" rel="index"><span itemprop="name">web前端</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="热度" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">热度：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/03/11/vue%E9%A1%B9%E7%9B%AE%E9%83%A8%E7%BD%B2%E5%88%B0Gitee%20Pages%E5%92%8CGitHub%20Pages/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/03/11/vue%E9%A1%B9%E7%9B%AE%E9%83%A8%E7%BD%B2%E5%88%B0Gitee%20Pages%E5%92%8CGitHub%20Pages/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>使用Gitee Pages实现静态页面（<a target="_blank" rel="noopener" href="https://hxy1997.gitee.io/music_player/%E6%A8%A1%E6%9D%BF">悦听播放器(Gitee Pages)</a> 和<a href="https://hxy1997.xyz/music_player/%E6%A8%A1%E6%9D%BF">悦听播放器(GitHub Pages)</a>）部署后 ，我尝试着将自己学习搭建的Vue电商项目托管至Gitee Pages，实现项目的正式上线 <a target="_blank" rel="noopener" href="https://hxy1997.gitee.io/vue_shops/">Vue电商项目(Gitee Pages)</a>和<a href="https://hxy1997.xyz/vue_shops/">Vue电商项目(GitHub Pages)</a></p>
<span id="more"></span>

<h1 id="1-简单的音乐播放器静态页面"><a href="#1-简单的音乐播放器静态页面" class="headerlink" title="1. 简单的音乐播放器静态页面"></a>1. 简单的音乐播放器静态页面</h1><h2 id="1-1-将项目提交至gitee"><a href="#1-1-将项目提交至gitee" class="headerlink" title="1.1 将项目提交至gitee"></a>1.1 将项目提交至gitee</h2><p>到Gitee上新建仓库，写仓库名称 选择是否开源 </p>
<p>使用git remote add origin <a target="_blank" rel="noopener" href="https://gitee.com/%E7%A0%81%E4%BA%91%E7%94%A8%E6%88%B7%E5%90%8D/%E9%A1%B9%E7%9B%AE%E5%90%8D">https://gitee.com/码云用户名/项目名</a> / 添加远程仓库。</p>
<p>git pull origin master 命令，将码云上的仓库pull到先前创建的文件夹中，期间需要输入gitee上面的账号和密码，输入完成密码之后点击 OK。<br>可能会出现以下提示问题：</p>
<p>这是因为没有配置提交时的用户名和邮箱的原因，你可以直接执行：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.name &quot;Your Name&quot;</span><br><span class="line">git config --global user.email &quot;you@example.com&quot;</span><br></pre></td></tr></table></figure>

<p>完毕之后再把将要上传的文件，全部添加到之前在桌面创建的文件夹中并使用git add .（. 表示所有的）或者 git add 文件名 // 将文件保存到缓存区<br>然后使用git commit -m ‘这里写新推送的文件描述’ //添加文件描述<br>使用git push origin master ，将本地仓库推送到远程仓库，之后去刷新gitee就能看到推送上去的项目了。</p>
<h2 id="1-2-配置Gitee-Page"><a href="#1-2-配置Gitee-Page" class="headerlink" title="1.2 配置Gitee Page"></a>1.2 配置Gitee Page</h2><p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418145848.png" alt="在这里插入图片描述"></p>
<p>点击项目导航栏中的<code>服务 --&gt; Gitee Pages</code></p>
<h2 id="1-3-访问网站"><a href="#1-3-访问网站" class="headerlink" title="1.3 访问网站"></a>1.3 访问网站</h2><p>打开网站 https://码云用户名.gitee.io/项目名/入口文件 即可访问，注意入口文件为index.html可省略，我的项目入口文件不是，所以需要，打开<a target="_blank" rel="noopener" href="https://hxy1997.gitee.io/music_player/%E6%A8%A1%E6%9D%BF">悦听播放器</a> 可以享用音乐了</p>
<h2 id="1-4-将码云库同步到Github库"><a href="#1-4-将码云库同步到Github库" class="headerlink" title="1.4 将码云库同步到Github库"></a>1.4 将码云库同步到Github库</h2><h4 id="步骤一：在github中新建一个项目"><a href="#步骤一：在github中新建一个项目" class="headerlink" title="步骤一：在github中新建一个项目"></a>步骤一：在github中新建一个项目</h4><p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150113.webp" alt="img"></p>
<h4 id="步骤二：在码云中复制要导入github中的git地址"><a href="#步骤二：在码云中复制要导入github中的git地址" class="headerlink" title="步骤二：在码云中复制要导入github中的git地址"></a>步骤二：在码云中复制要导入github中的git地址</h4><p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150049.webp" alt="img"></p>
<h4 id="步骤三：在github平台进入步骤一创建的项目，点击“Import-code”进入导入页面"><a href="#步骤三：在github平台进入步骤一创建的项目，点击“Import-code”进入导入页面" class="headerlink" title="步骤三：在github平台进入步骤一创建的项目，点击“Import code”进入导入页面"></a>步骤三：在github平台进入步骤一创建的项目，点击“Import code”进入导入页面</h4><p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150132.webp" alt="img"></p>
<h4 id="步骤四：在导入页面，将步骤二复制出来的码云中项目的git地址，粘贴到“url”中，并点击“Begin-import”"><a href="#步骤四：在导入页面，将步骤二复制出来的码云中项目的git地址，粘贴到“url”中，并点击“Begin-import”" class="headerlink" title="步骤四：在导入页面，将步骤二复制出来的码云中项目的git地址，粘贴到“url”中，并点击“Begin import”"></a>步骤四：在导入页面，将步骤二复制出来的码云中项目的git地址，粘贴到“url”中，并点击“Begin import”</h4><p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150154.webp" alt="img"></p>
<blockquote>
<p>注意：有时候步骤四在导入时，会出现一个500异常界面。这时，我们不需要管它，只需要重新进入我们新建的项目，再次从步骤三开始操作即可， 这时候便会看见项目正在导入，稍等一段时间，便会提示你导入成功，最后我们再次访问该项目，便会发现码云中的项目已经导入到github中来了。（导入成功GitHub会发邮件提醒）</p>
</blockquote>
<p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150211.webp" alt="img"></p>
<p>500异常界面</p>
<p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150226.webp" alt="img"></p>
<p>再次进入时的导入界面</p>
<h4 id="步骤五：开启GitHub-Pages"><a href="#步骤五：开启GitHub-Pages" class="headerlink" title="步骤五：开启GitHub Pages"></a>步骤五：开启GitHub Pages</h4><p>点击右上角的 Settings</p>
<p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150239.jpeg" alt="img"></p>
<p>找到 GitHub Pages 选项，设置好后，<a target="_blank" rel="noopener" href="https://github用户名.github.io/%E9%A1%B9%E7%9B%AE%E5%90%8D/%E5%85%A5%E5%8F%A3%E6%96%87%E4%BB%B6">https://Github用户名.github.io/项目名/入口文件</a></p>
<h1 id="2-使用vue-cli脚手架创建的页面提交至Gitee-Pages"><a href="#2-使用vue-cli脚手架创建的页面提交至Gitee-Pages" class="headerlink" title="2. 使用vue-cli脚手架创建的页面提交至Gitee Pages"></a>2. 使用vue-cli脚手架创建的页面提交至Gitee Pages</h1><h2 id="2-1-调整本地项目"><a href="#2-1-调整本地项目" class="headerlink" title="2.1 调整本地项目"></a>2.1 调整本地项目</h2><h3 id="在根目录下增加-spa文件"><a href="#在根目录下增加-spa文件" class="headerlink" title="在根目录下增加.spa文件"></a>在根目录下增加.spa文件</h3><p>首先，根据<a target="_blank" rel="noopener" href="https://gitee.com/help/articles/4237">官方指示</a></p>
<p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150250.png" alt="在这里插入图片描述"></p>
<p>在项目路径中添加<code>.spa</code>文件</p>
<p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150259.png" alt="在这里插入图片描述"></p>
<p>原理，我不是很清楚，应该是给Nginx做一个<code>标识</code>作用吧。</p>
<h3 id="配置production版本路径名称"><a href="#配置production版本路径名称" class="headerlink" title="配置production版本路径名称"></a>配置production版本路径名称</h3><p>根目录下的vue.config.js文件，如下图箭头那个要改为项目文件名称</p>
<p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150309.png" alt="img"></p>
<p>在本地运行<code>npm run build</code>，得到/dist</p>
<p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150320.png" alt="在这里插入图片描述"></p>
<h3 id="配置-gitignore文件"><a href="#配置-gitignore文件" class="headerlink" title="配置.gitignore文件"></a>配置.gitignore文件</h3><p>首先要在.gitignore文件去掉/dist，这个文件默认是不上传的，但是执行打包bulid的时候会生成dist文件，而线上访问的是打包之后的dist文件；</p>
<p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150327.png" alt="img"></p>
<h2 id="2-2-将项目提交至gitee"><a href="#2-2-将项目提交至gitee" class="headerlink" title="2.2 将项目提交至gitee"></a>2.2 将项目提交至gitee</h2><p>参考1.2节的做法，此步不再赘述</p>
<h2 id="2-3-配置Gitee-Page"><a href="#2-3-配置Gitee-Page" class="headerlink" title="2.3 配置Gitee Page"></a>2.3 配置Gitee Page</h2><p>用上次同样的方法点进Gitee Pages</p>
<p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150337.png" alt="img"></p>
<p> 这一次部署目录要填写dist</p>
<p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150626.png" alt="img"></p>
<h2 id="2-4-访问网站"><a href="#2-4-访问网站" class="headerlink" title="2.4 访问网站"></a>2.4 访问网站</h2><p>打开网站 https://码云用户名.gitee.io/项目名/入口文件 即可访问，注意入口文件为index.html可省略，这次vue-cli创建的项目不需要，打开线 <a target="_blank" rel="noopener" href="https://hxy1997.gitee.io/vue_shops/">Vue电商项目</a> 就可以体验电商项目了</p>
<h1 id="3-使用vue-cli脚手架创建的页面提交至GitHub-Pages"><a href="#3-使用vue-cli脚手架创建的页面提交至GitHub-Pages" class="headerlink" title="3. 使用vue-cli脚手架创建的页面提交至GitHub Pages"></a>3. 使用vue-cli脚手架创建的页面提交至GitHub Pages</h1><h2 id="3-1-GitHub-Pages服务说明与注意事项"><a href="#3-1-GitHub-Pages服务说明与注意事项" class="headerlink" title="3.1 GitHub Pages服务说明与注意事项"></a>3.1 GitHub Pages服务说明与注意事项</h2><p>在你的github项目设置的GitHub Pages项，有这么一句话：</p>
<blockquote>
<p><a target="_blank" rel="noopener" href="https://pages.github.com/">GitHub Pages</a> is designed to host your personal, organization, or project pages from a GitHub repository.<br>译：GitHub Pages旨在从GitHub存储库中托管您的个人、组织或项目页面。</p>
</blockquote>
<p>这句话主要是介绍GitHub Pages的宗旨，<a target="_blank" rel="noopener" href="https://pages.github.com/">Github Pages</a> 官网上有其他的一些介绍，由于都是英文，我们看着费劲，不如直接看Gitee Pages 服务的说明，两者都差不多。</p>
<p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150611.png" alt="img"><br>注意事项大家了解一下切勿违反就行，这里重点给大家说的是红框圈出的内容，Pages服务只支持静态项目，若你的项目需要服务器支持，就不适合部署到这上面了。</p>
<h2 id="3-2-项目配置注意事项"><a href="#3-2-项目配置注意事项" class="headerlink" title="3.2 项目配置注意事项"></a>3.2 项目配置注意事项</h2><h4 id="1、vue-router-不要开启-history-模式"><a href="#1、vue-router-不要开启-history-模式" class="headerlink" title="1、vue-router 不要开启 history 模式"></a>1、vue-router 不要开启 history 模式</h4><p>正常项目中我们会因为网站路径中带有“#”而将vue-router开启history模式，以去掉#号。但开启history模式需要服务器的支持，因此在github pages中不支持这一模式，所以我们不能开启history模式。</p>
<h4 id="2、在-vue-config-js-中设置正确的-publicPath"><a href="#2、在-vue-config-js-中设置正确的-publicPath" class="headerlink" title="2、在 vue.config.js 中设置正确的 publicPath"></a>2、在 vue.config.js 中设置正确的 publicPath</h4><p>要将项目部署到 https://<USERNAME>.github.io/<REPO>/ 上 (即仓库地址为 <a target="_blank" rel="noopener" href="https://github.com/">https://github.com/</a><USERNAME>/<REPO>)，可将 publicPath 设为 “/<REPO>/“。<br>举个例子，我的仓库名字为“vue-admin-web”，那么 vue.config.js 的内容应如下所示：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;&#x2F; vue.config.js</span><br><span class="line">module.exports &#x3D; &#123;</span><br><span class="line">  publicPath: process.env.NODE_ENV &#x3D;&#x3D;&#x3D; &#39;production&#39;</span><br><span class="line">    ? &#39;&#x2F;vue-admin-web&#x2F;&#39;</span><br><span class="line">    : &#39;&#x2F;&#39;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="3-3-部署github项目"><a href="#3-3-部署github项目" class="headerlink" title="3.3 部署github项目"></a>3.3 部署github项目</h2><p>做好上述的配置后，就可以把项目推送到github上了，首先在Github上新建仓库</p>
<p>在本地上.git中的config中[remote “origin”]下增加一行</p>
<p>  url = <a href="mailto:&#103;&#x69;&#116;&#x40;&#103;&#105;&#x74;&#x68;&#117;&#x62;&#46;&#x63;&#x6f;&#x6d;">&#103;&#x69;&#116;&#x40;&#103;&#105;&#x74;&#x68;&#117;&#x62;&#46;&#x63;&#x6f;&#x6d;</a>:<USERNAME>/<REPO>.git</p>
<p>gitpush成功把项目推送到了该仓库下。接下来把项目部署到github pages上。【参考 <a target="_blank" rel="noopener" href="https://cli.vuejs.org/zh/guide/deployment.html#github-pages">vue-cli</a> 官方说明】<br>1、在项目目录下，创建内容如下的 deploy.sh 文件</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">#!&#x2F;usr&#x2F;bin&#x2F;env sh</span><br><span class="line"></span><br><span class="line"># 当发生错误时中止脚本</span><br><span class="line">set -e</span><br><span class="line"></span><br><span class="line"># 构建</span><br><span class="line">npm run build</span><br><span class="line"></span><br><span class="line"># cd 到构建输出的目录下 </span><br><span class="line">cd dist</span><br><span class="line"></span><br><span class="line">git init</span><br><span class="line">git add -A</span><br><span class="line">git commit -m &#39;deploy&#39;</span><br><span class="line"></span><br><span class="line"># 部署到 https:&#x2F;&#x2F;&lt;USERNAME&gt;.github.io&#x2F;&lt;REPO&gt;</span><br><span class="line">git push -f git@github.com:&lt;USERNAME&gt;&#x2F;&lt;REPO&gt;.git master:gh-pages</span><br><span class="line"></span><br><span class="line">cd -</span><br></pre></td></tr></table></figure>

<p>2、运行该文件<br>在项目目录下打开cmd命令窗口（快捷方法：在项目目录下，按住Shift键，然后鼠标右键，选择“在此处打开命令窗口”）</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;&#x2F; Linux环境下</span><br><span class="line">bash deploy.sh</span><br><span class="line">&#x2F;&#x2F; Windows环境下</span><br><span class="line">deploy.sh</span><br></pre></td></tr></table></figure>

<p>运行后，git就会执行该文件里的命令。大致就是，构建打包项目代码，然后将打包后的代码上传到仓库中的 gh-pages 分支。（注意：新建的仓库默认只有master分支，没有gh-pages分支，但不需要你手动新建该分支，运行该文件后，会自动帮你生成gh-pages分支）<br>这样，你的项目就已经部署到github pages 了。在你的github项目的 Settings - Options 下的 GitHub Pages项里，可以看到你的项目线上网站地址。<br>示例：<a target="_blank" rel="noopener" href="https://marco-hui.github.io/vue-admin-web/">https://marco-hui.github.io/vue-admin-web/</a></p>
<p><img data-src="https://cdn.jsdelivr.net/gh/huxingyi1997/my_img/img/20210418150530.png" alt="img"></p>

    </div>

    
    
    
      
<div>
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
</div>
        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

        <div class="social-item">
          <a target="_blank" class="social-link" href="/atom.xml">
            <span class="icon">
              <i class="fa fa-rss"></i>
            </span>

            <span class="label">RSS</span>
          </a>
        </div>
    </div>
  </div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Vue/" rel="tag"><i class="fa fa-tag"></i> Vue</a>
              <a href="/tags/%E5%AE%9E%E6%88%98/" rel="tag"><i class="fa fa-tag"></i> 实战</a>
              <a href="/tags/Gitee-Pages/" rel="tag"><i class="fa fa-tag"></i> Gitee Pages</a>
              <a href="/tags/GitHub-Pages/" rel="tag"><i class="fa fa-tag"></i> GitHub Pages</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2021/03/09/HTML%E5%92%8C%E6%B5%8F%E8%A7%88%E5%99%A8/" rel="prev" title="HTML和浏览器">
      <i class="fa fa-chevron-left"></i> HTML和浏览器
    </a></div>
      <div class="post-nav-item">
    <a href="/2021/03/14/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C/" rel="next" title="计算机网络">
      计算机网络 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#1-%E7%AE%80%E5%8D%95%E7%9A%84%E9%9F%B3%E4%B9%90%E6%92%AD%E6%94%BE%E5%99%A8%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2"><span class="nav-text">1. 简单的音乐播放器静态页面</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-1-%E5%B0%86%E9%A1%B9%E7%9B%AE%E6%8F%90%E4%BA%A4%E8%87%B3gitee"><span class="nav-text">1.1 将项目提交至gitee</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-2-%E9%85%8D%E7%BD%AEGitee-Page"><span class="nav-text">1.2 配置Gitee Page</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-3-%E8%AE%BF%E9%97%AE%E7%BD%91%E7%AB%99"><span class="nav-text">1.3 访问网站</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-4-%E5%B0%86%E7%A0%81%E4%BA%91%E5%BA%93%E5%90%8C%E6%AD%A5%E5%88%B0Github%E5%BA%93"><span class="nav-text">1.4 将码云库同步到Github库</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%AD%A5%E9%AA%A4%E4%B8%80%EF%BC%9A%E5%9C%A8github%E4%B8%AD%E6%96%B0%E5%BB%BA%E4%B8%80%E4%B8%AA%E9%A1%B9%E7%9B%AE"><span class="nav-text">步骤一：在github中新建一个项目</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%AD%A5%E9%AA%A4%E4%BA%8C%EF%BC%9A%E5%9C%A8%E7%A0%81%E4%BA%91%E4%B8%AD%E5%A4%8D%E5%88%B6%E8%A6%81%E5%AF%BC%E5%85%A5github%E4%B8%AD%E7%9A%84git%E5%9C%B0%E5%9D%80"><span class="nav-text">步骤二：在码云中复制要导入github中的git地址</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%AD%A5%E9%AA%A4%E4%B8%89%EF%BC%9A%E5%9C%A8github%E5%B9%B3%E5%8F%B0%E8%BF%9B%E5%85%A5%E6%AD%A5%E9%AA%A4%E4%B8%80%E5%88%9B%E5%BB%BA%E7%9A%84%E9%A1%B9%E7%9B%AE%EF%BC%8C%E7%82%B9%E5%87%BB%E2%80%9CImport-code%E2%80%9D%E8%BF%9B%E5%85%A5%E5%AF%BC%E5%85%A5%E9%A1%B5%E9%9D%A2"><span class="nav-text">步骤三：在github平台进入步骤一创建的项目，点击“Import code”进入导入页面</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%AD%A5%E9%AA%A4%E5%9B%9B%EF%BC%9A%E5%9C%A8%E5%AF%BC%E5%85%A5%E9%A1%B5%E9%9D%A2%EF%BC%8C%E5%B0%86%E6%AD%A5%E9%AA%A4%E4%BA%8C%E5%A4%8D%E5%88%B6%E5%87%BA%E6%9D%A5%E7%9A%84%E7%A0%81%E4%BA%91%E4%B8%AD%E9%A1%B9%E7%9B%AE%E7%9A%84git%E5%9C%B0%E5%9D%80%EF%BC%8C%E7%B2%98%E8%B4%B4%E5%88%B0%E2%80%9Curl%E2%80%9D%E4%B8%AD%EF%BC%8C%E5%B9%B6%E7%82%B9%E5%87%BB%E2%80%9CBegin-import%E2%80%9D"><span class="nav-text">步骤四：在导入页面，将步骤二复制出来的码云中项目的git地址，粘贴到“url”中，并点击“Begin import”</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%AD%A5%E9%AA%A4%E4%BA%94%EF%BC%9A%E5%BC%80%E5%90%AFGitHub-Pages"><span class="nav-text">步骤五：开启GitHub Pages</span></a></li></ol></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#2-%E4%BD%BF%E7%94%A8vue-cli%E8%84%9A%E6%89%8B%E6%9E%B6%E5%88%9B%E5%BB%BA%E7%9A%84%E9%A1%B5%E9%9D%A2%E6%8F%90%E4%BA%A4%E8%87%B3Gitee-Pages"><span class="nav-text">2. 使用vue-cli脚手架创建的页面提交至Gitee Pages</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#2-1-%E8%B0%83%E6%95%B4%E6%9C%AC%E5%9C%B0%E9%A1%B9%E7%9B%AE"><span class="nav-text">2.1 调整本地项目</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%9C%A8%E6%A0%B9%E7%9B%AE%E5%BD%95%E4%B8%8B%E5%A2%9E%E5%8A%A0-spa%E6%96%87%E4%BB%B6"><span class="nav-text">在根目录下增加.spa文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%85%8D%E7%BD%AEproduction%E7%89%88%E6%9C%AC%E8%B7%AF%E5%BE%84%E5%90%8D%E7%A7%B0"><span class="nav-text">配置production版本路径名称</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE-gitignore%E6%96%87%E4%BB%B6"><span class="nav-text">配置.gitignore文件</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-2-%E5%B0%86%E9%A1%B9%E7%9B%AE%E6%8F%90%E4%BA%A4%E8%87%B3gitee"><span class="nav-text">2.2 将项目提交至gitee</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-3-%E9%85%8D%E7%BD%AEGitee-Page"><span class="nav-text">2.3 配置Gitee Page</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-4-%E8%AE%BF%E9%97%AE%E7%BD%91%E7%AB%99"><span class="nav-text">2.4 访问网站</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#3-%E4%BD%BF%E7%94%A8vue-cli%E8%84%9A%E6%89%8B%E6%9E%B6%E5%88%9B%E5%BB%BA%E7%9A%84%E9%A1%B5%E9%9D%A2%E6%8F%90%E4%BA%A4%E8%87%B3GitHub-Pages"><span class="nav-text">3. 使用vue-cli脚手架创建的页面提交至GitHub Pages</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#3-1-GitHub-Pages%E6%9C%8D%E5%8A%A1%E8%AF%B4%E6%98%8E%E4%B8%8E%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9"><span class="nav-text">3.1 GitHub Pages服务说明与注意事项</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-2-%E9%A1%B9%E7%9B%AE%E9%85%8D%E7%BD%AE%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9"><span class="nav-text">3.2 项目配置注意事项</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#1%E3%80%81vue-router-%E4%B8%8D%E8%A6%81%E5%BC%80%E5%90%AF-history-%E6%A8%A1%E5%BC%8F"><span class="nav-text">1、vue-router 不要开启 history 模式</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2%E3%80%81%E5%9C%A8-vue-config-js-%E4%B8%AD%E8%AE%BE%E7%BD%AE%E6%AD%A3%E7%A1%AE%E7%9A%84-publicPath"><span class="nav-text">2、在 vue.config.js 中设置正确的 publicPath</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-3-%E9%83%A8%E7%BD%B2github%E9%A1%B9%E7%9B%AE"><span class="nav-text">3.3 部署github项目</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="hxy"
      src="/images/Robben.gif">
  <p class="site-author-name" itemprop="name">hxy</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">80</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">8</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">120</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/huxingyi1997" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;huxingyi1997" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:huxingyi1997@zju.edu.cn" title="E-Mail → mailto:huxingyi1997@zju.edu.cn" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-frog"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">hxy</span>
</div>

<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共1039.2k字</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/lozad@1/dist/lozad.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : true,
      appId      : 'pQsO3ySbU4VtWN2j1FLA74Ha-gzGzoHsz',
      appKey     : 'QYacMDY2VY7Wazprg1X6FiUv',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : 'zh-cn' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

  
  <!-- 动态背景特效 -->
  <!-- 樱花特效 -->
    <script async src="/js/src/sakura.js"></script>
    <script async src="/js/src/fairyDustCursor.js"></script>
</body>
</html>
